package com.zj.aopspringboot01;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
public class MyController {

    @Autowired
    private UserService service;

    @PostMapping("/add")
    public int test(@RequestBody User user) {
        int res=service.addUser(user);
        return res;
    }

    @GetMapping("/query")
    public User testQuery(int id) {
        User res=service.select(id);
        return res;
    }

}
